package com.tpp.comm.pojo;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * tp_task
 * @author 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TpTask implements Serializable {
    /**
     * 任务id
     */
    private String id;

    /**
     * 任务类型
     */
    private String taskType;

    /**
     * 交换机名称
     */
    private String mqExchange;

    /**
     * routingkey
     */
    private String mqRoutingKey;

    /**
     * 任务请求的内容
     */
    private String requestBody;

    /**
     * 乐观锁版本号
     */
    private Integer version;

    /**
     * 0：未发送 1：已发送 2：超时失败
     */
    private Integer status;

    /**
     * 任务错误信息
     */
    private String errorMsg;

    /**
     * 任务重试次数
     */
    private Integer tryCount;


    private String orderNo;

    /**
     * 任务超时时间
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime overtime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;
}